import 'package:flutter/material.dart';
import 'package:hxdj/common/my_get_it.dart';
import 'package:hxdj/message/rongcloud/chat/rc_chat_global_viewmodel.dart';
import 'package:hxdj/message/rongcloud/chat/tim_uikit_text_field_controller.dart';
import 'package:hxdj/message/rongcloud/chat/rc_chat_separate_view_model.dart';
import 'package:scroll_to_index/scroll_to_index.dart';

class RCChatController {
  late RCChatSeparateViewModel? model;
  late TIMUIKitInputTextFieldController? textFieldController;
  late AutoScrollController? scrollController;

  final RCChatGlobalModel globalChatModel = serviceLocator<RCChatGlobalModel>();

  RCChatController({RCChatSeparateViewModel? viewModel}) {
    if (viewModel != null) {
      model = viewModel;
    }
  }

  //发送消息
  sendMessage(BuildContext context,String targetId, String text) {
    globalChatModel.sendMessageText(context,targetId, text);
  }
}
